import numpy as np
from matplotlib import pyplot as plt, animation

fig, ax = plt.subplots(1, 1, figsize=(5, 5), dpi=150)
point, = ax.plot([0], [0], 'or', markersize=6)
ax.set_xlim(-10, 10)  # 设置x轴的显示范围
ax.set_ylim(-10, 10)  # 设置y轴的显示范围


def update(i):
    x = 7
    y = -3


    point.set_xdata(x)
    point.set_ydata(y)

    # 省略

    return point,


ani = animation.FuncAnimation(fig, update,interval=40, blit=False, init_func=None, repeat=False)
plt.show()
